package  
{
	import flash.display.Sprite;
	
	/**
	 * ...
	 * @author chenjie
	 */
	public class TaskManager extends Sprite 
	{
		public static var g_singleTaskManger:TaskManager = null;
		
		public var linked:LinkedList = new LinkedList();
		
		public var taskVector:Vector.<Task> = new Vector.<Task>();
		
		//public var linkList:LinkedList = new LinkedList();   //链表备用
		
		//protected var taskXml:XML;
		
		
		public function TaskManager() 
		{
			linkList.clear();
			Init();
		}
		
		
		public static function getInstance():TaskManager
		{
			if (g_singleTaskManger == null)
			{
				g_singleTaskManger = new TaskManager;
			}
			return g_singleTaskManger;
		}
		
		private function Init():void
		{
			var taskXml:XML = <myxml>   
			<item id='1'>   
				 <taskId>任务1</taskId>   
				 <taskName>task1</taskName>   
				 <taskDesc>hello</taskDesc>   
			</item>
			<item id='2'>  
				<taskId>任务2</taskId>   
				 <taskName>task2</taskName>   
				 <taskDesc>hello</taskDesc>   
			</item>
			</myxml>;
			
			parseXml(taskXml);
		}
		
		private function  parseXml(xml:XML):void
		{
			for each (var property:XML in xml.item)
			{
				var task:Task = new Task;
				task.taskId = property.taskId;
				task.taskDesc = property.taskDesc;
				taskVector.push(task);
				
				//linkList.append(task,linkList.size());
				//trace(property.taskName);
			}
		}
		
		
		public function getTask():Task
		{
			return null;
		}
		
	}

}